define(function(require, exports, module) {
	"require:nomunge,exports:nomunge,module:nomunge";

	var app = require('mokit/app');
	var ArticleInfoView = require('../views/article-info');
	var commonUtils = require('../common/utils');
	var Article = require('../models/Article');
	var Share = require("../models/Share");
	var Comment = require("../models/Comment");	

	/**
	 * 社友录页面控制器
	 */
	return app.controller.create({
		isSetting: true,
		/**
		 * 默认action
		 */
		index: function(context) {
			var self = this;
			var id = context.routeData.id;
			Article.getInfo(id, function() {
				Article.getHotList(function(){
					Comment.getList(id, function(){
						Article.commentList = Comment.list;
						self.setView(new ArticleInfoView({
							model: Article
						}));						
					});
				});
			});
		},
		
		sayGood: function(context){
			Share.sayGood(0, Article.shid, function(){
				alert("已赞");
			});
		},
		
		add2fav: function(context){
			Share.add2fav(0, Article.shid, function(){
				alert("已收藏");
			});
		},		
		
		share: function(context){
			Share.share(0,0,function(){
				alert("已分享");
			});
		},
	});

});